// package com.example.controller;
//
// import com.example.domain.Exam;
// import com.example.service.ExamService;
// import org.springframework.beans.factory.annotation.Autowired;
// import org.springframework.stereotype.Controller;
// import org.springframework.web.bind.annotation.RequestMapping;
// import org.springframework.web.bind.annotation.RequestMethod;
// import org.springframework.web.bind.annotation.RequestParam;
// import org.springframework.web.bind.annotation.ResponseBody;
//
// import java.util.List;
//
// @Controller
// public class ExamController {
//
//     @Autowired
//     private ExamService examServive;
//
//     @RequestMapping(value = "/exam/list", method = RequestMethod.POST)
//     @ResponseBody
//     public List<Exam> getAllExam(@RequestParam(name = "page", defaultValue = "0", required = false) int page,
//                                  @RequestParam(name = "rows", defaultValue = "10", required = false) int rows,
//                                  @RequestParam(name = "sort", defaultValue = "id", required = false) String sort,
//                                  @RequestParam(name = "order", defaultValue = "DESC", required = false) String order) {
//         int now = 0;
//         if (page > 0) now = page - 1;
//         return examServive.getAllExam(now, rows, sort, order);
//     }
//
//     @RequestMapping(value = "/exam/delete", method = RequestMethod.POST)
//     @ResponseBody
//     public String delete(int id) {
//         examServive.delete(id);
//         return "success";
//     }
//
//     @RequestMapping(value = "/exam/add", method = RequestMethod.POST)
//     @ResponseBody
//     public String add() {
//         // examServive.delete(id);
//         return "success";
//     }
//
// }
